package com.test.clyq.serviceImpl;

import java.util.List;

import com.test.clyq.dao.OptionDao;
import com.test.clyq.entity.Option;
import com.test.clyq.entity.Users;
import com.test.clyq.service.OptionService;
import com.test.service.impl.BaseManager;
import com.test.util.Pagination;

/**
 * OptionServiceImpl. <br>
 * 评价选项管理.
 * <p>
 * Copyright: Copyright (c) 2010-3-17 下午04:30:46
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
public class OptionServiceImpl extends BaseManager implements OptionService {

	private OptionDao downFileDao;

	/**
	 * 添加评价选项
	 * 
	 * @param file
	 * @param user
	 */
	public void addOption(Option file, Users user) {
		downFileDao.addOption(file, user);
	}

	/**
	 * 删除评价选项
	 * 
	 * @param id
	 * @param user
	 */
	public boolean deleteOption(Long id, Users user) {
		return downFileDao.deleteOption(id, user);
	}

	public OptionDao getDownFileDao() {
		return downFileDao;
	}

	/**
	 * 获取一个评价选项
	 * 
	 * @param id
	 * @return
	 */
	public Option getOneOption(Long id) {
		return downFileDao.getOneOption(id);
	}

	/**
	 * 通过分页获取评价选项
	 * 
	 * @param pagination
	 * @param categoryId
	 * @return
	 */
	public List<Option> getOptionByPage(Pagination pagination, Long categoryId) {
		return downFileDao.getOptionByPage(pagination, categoryId);
	}

	/**
	 * 获取所有评价选项
	 * 
	 * @param categoryId
	 *            所属栏目id
	 * @return
	 */
	public List<Option> getOptions(Long categoryId) {
		return downFileDao.getOptions(categoryId);
	}

	public void setDownFileDao(OptionDao downFileDao) {
		this.downFileDao = downFileDao;
	}

	/**
	 * 修改评价选项
	 * 
	 * @param id
	 * @param user
	 */
	public void updateOption(Option file, Users user) {
		downFileDao.updateOption(file, user);
	}
}
